Skip to content

[Cache] Reword "max lifetime" to "default lifetime" #17348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

colinodell
Copy link
Contributor

The use of the word "maximum" here is not very clear; it's easy for somebody to mistakenly believe that this parameter limits the TTL of the higher caches to some maximum value. For example, if the second cache returns a hit with a TTL of 3600, then $maxLifetime = 60 would mean the first cache should use a TTL of 60 since that's the "maximum lifetime". But looking at the code, that's not what happens - this parameter actually works as a default TTL for items without an expiry.

I believe this possible confusion is why the variable was renamed in #26984 so let's update the documentation accordingly. Hopefully this will prevent others from making the same misunderstandings that I did :)

@carsonbot carsonbot added this to the 4.4 milestone Oct 13, 2022
@carsonbot carsonbot changed the title Reword "max lifetime" to "default lifetime" [Cache] Reword "max lifetime" to "default lifetime" Oct 14, 2022
@javiereguiluz
Copy link
Member

Nice fix and perfect explanation! Thanks Colin.

@javiereguiluz javiereguiluz merged commit 0aacabb into symfony:4.4 Oct 14, 2022
@colinodell colinodell deleted the patch-2 branch October 14, 2022 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants